﻿using System;
using System.Collections.Specialized;
using System.Drawing.Printing;


namespace YT.Commons
{
    public enum SystemModules
    {
        
        MeniereDisease=0,
        SUDDENDEAFNESS=1,
        Dizziness=2,
        NOSE=3,
        Others=4,
        IgE=5
    }
    public enum RangeType
    { Big, Small, BigEqual, SamllEqual, Like, Equal };
    public enum FormStatus
    {
        AddNew = 0,//let the Form Can be Edit and give the form default value
        Update,//let the Form Changed to Edit from the Query status
        Query,//Get datat from Meta and Diaplay them to Form and form can't be Edit
        Delete,//Clear the Page Content and Save the Change to Meta
        Loading //show forms is loading and still not show  .
    }
    public enum SqlOption
    {
        SqlPartTableName = 0,
        SqlPartMain = 1,
        SqlPartWhere = 2,
        SqlPartOrderBy = 3,
        SqlPartInner = 4,
        SqlPartAll = 5
    }

    public enum DtlTitleType
    { 
        Single=0,
        Mulit,
        Remark    
    }


    public enum ExceptionType
    {
        System = 0,
        User = 1
    }


    public enum DateFormatOption
    {
        DateFmtMDY = 0,
        FmtDtp,
        DateFmtMD,
        DateFmtYMD,
        DateFmtMY
    }
    public enum DataType
    {
        String,
        DateTime,
        Integer,
        Numeric,
        Bool,
        Byte
    }


    public enum TitleType
    {
        MeniereDisease=0,
        SuddenDeafness=1,
        Dizziness =2,
        NOSE=3,
        OTHERS=4,
        IgE =5
    }

    public enum TopicType
    {
        SickHistory = 0,  //病史调查
        ExamBeforeTreatTitle,  //治疗前检查
        TreatmentEffectAfterTreate, //治疗结束后综合疗效评估
        UntowardEffectTitle,  //治疗后不良反应报告
        TreatmentEffectTitle,  //疗效评估
        JacobsonTitle,  //眩晕问卷和量化评估表 和 主观评价
        Others
    }

    public enum JobocoType
    { 
        TreatEffect=0,
        AfterTreat,
        TreatEffect_Hurry,
        TreatEffect_Watch,
        TreatEffect_Sure
    }

    public struct  LogStruct
    {
        public string strSickRecID;
        public string strTypeDesc; //检查项目的描述
        public TitleType titleType;  //是哪个模块
        public DateTime datExamDate; //检查的日期
        public string strExamSeqNo; //如果有seqno（多次检查）等，就要填此字段
        public string strExamRecID; //如果没有SeqNo, 就要填RecID
    }

    public enum FormulaType
    {
        TotalIgG4 = 0,
        IgG4 = 1,
        IgE = 2
    }
    public class PrintInfo
    {
        public enum OutputType { Preview = 0, Print, PDF, Excel, Email, Fax, Nothing };

        public enum ExportType { PDF = 3, Excel };
        /*
         * this is for save report. the name will be used file name. 
         */

        private System.Collections.Specialized.NameValueCollection mVarCollection = new System.Collections.Specialized.NameValueCollection();
        public System.Collections.Specialized.NameValueCollection VarCollection
        {
            get { return mVarCollection; }
            set { mVarCollection = value; }
        }
        private string m_FaxEmailInfo = "";

        public string FaxEmailInfo
        {
            get
            {
                return m_FaxEmailInfo;
            }
            set
            {
                m_FaxEmailInfo = value;
            }
        }


        private string m_ReportExportFileName = "";
        public string ReportExportFileName
        {
            get
            {
                return this.m_ReportExportFileName;
            }
            set
            {
                this.m_ReportExportFileName = value;
            }
        }
        private ExportType m_ReporExportType = ExportType.PDF;
        public ExportType ReportExportType
        {
            get
            {
                return this.m_ReporExportType;
            }
            set
            {
                this.m_ReporExportType = value;
            }
        }

        private string m_ReportTitle = "";
        public string ReportTitle
        {
            get
            {
                return this.m_ReportTitle;
            }
            set
            {
                this.m_ReportTitle = value;
            }
        }
        private string m_ReportPageTitle = "";
        public string ReportPageTitle
        {
            get
            {
                return this.m_ReportPageTitle;
            }
            set
            {
                this.m_ReportPageTitle = value;
            }
        }
        private string m_PrinterName = string.Empty;

        private string m_PrintCondition = "";

        public string PrintCondition
        {
            get
            {
                return this.m_PrintCondition;
            }
            set
            {
                this.m_PrintCondition = value;
            }
        }
        public string PrinterName
        {
            get
            {
                if (m_PrinterName.Length > 0)
                {
                    return m_PrinterName;
                }
                else
                {
                    return this.m_PrinterSetting.PrinterName;
                }
            }
            set
            {
                this.m_PrinterName = value;
            }
        }

        private PrinterSettings m_PrinterSetting;
        public PrinterSettings PrinterSetting
        {
            get
            {
                if (m_PrinterSetting == null)
                {
                    m_PrinterSetting = new PrinterSettings();
                }
                return this.m_PrinterSetting;
            }
            set
            {
                this.m_PrinterSetting = value;
            }
        }

        private OutputType m_OutputType = OutputType.Preview;
        public OutputType PrintType
        {
            get
            {
                return m_OutputType;
            }
            set
            {
                m_OutputType = value;
            }

        }

        private bool m_Landscape = false;

        public bool Landscape
        {
            get
            {
                return this.m_Landscape;
            }
            set
            {
                this.m_Landscape = value;
            }
        }

        /*
         * The pixel depth of the color range supported by the image output. 
         * Valid values are 1, 4, 8, 24, and 32. 
         * The default value is 24. 
         * ColorDepth is only supported for TIFF rendering and is otherwise ignored by the report server for other image output formats. 
         * Note: 
         * For this release of SQL Server, the value of this setting is ignored, and the TIFF image is always rendered as 24-bit.
        */
        private int m_ColorDepth = 24;

        public int ColorDepth
        {
            get
            {
                return this.m_ColorDepth;
            }
        }


        /*
         * The number of columns to set for the report. This value overrides the report's original settings.
         * 
         * not used
         * 
        */
        private int m_Columns = 0;

        public int Columns
        {
            get
            {
                return this.m_Columns;
            }
            set
            {
                this.m_Columns = value;
            }
        }


        /*
         * The column spacing to set for the report. This value overrides the report's original settings.
         * 
         * not used
         * 
        */
        private int m_ColumnSpacing = 0;

        public int ColumnSpacing
        {
            get
            {
                return this.m_ColumnSpacing;
            }
            set
            {
                this.m_ColumnSpacing = value;
            }
        }

        /*
         * The resolution of the output device in x-direction. The default value is 96.
         * 
        */
        private int m_DpiX = 96;

        public int DpiX
        {
            get
            {
                return this.m_DpiX;
            }
            set
            {
                this.m_DpiX = value;
            }
        }


        /*
         * The resolution of the output device in y-direction. The default value is 96.
         * 
        */
        private int m_DpiY = 96;

        public int DpiY
        {
            get
            {
                return this.m_DpiY;
            }
            set
            {
                this.m_DpiY = value;
            }
        }


        /*
         * The last page of the report to render. The default value is the value for StartPage.
         * 
         */
        private int m_EndPage = 0;

        public int EndPage
        {
            get
            {
                return this.m_EndPage;
            }
            set
            {
                this.m_EndPage = value;
            }
        }


        /*
         * The first page of the report to render. A value of 0 indicates that all pages are rendered. The default value is 1.
         * 
         */
        private int m_StartPage = 1;

        public int StartPage
        {
            get
            {
                return this.m_StartPage;
            }
            set
            {
                this.m_StartPage = value;
            }
        }

        /*
         * The bottom margin value, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 1in). This value overrides the report's original settings.
         * 
         */
        private decimal m_MarginBottom = 0;

        public decimal MarginBottom
        {
            get
            {
                return this.m_MarginBottom;
            }
            set
            {
                this.m_MarginBottom = value;
            }
        }


        /*
         * The top margin value, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 1in). This value overrides the report's original settings.
         * 
         */
        private decimal m_MarginTop = 0;

        public decimal MarginTop
        {
            get
            {
                return this.m_MarginTop;
            }
            set
            {
                this.m_MarginTop = value;
            }
        }


        /*
         * The left margin value, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 1in). This value overrides the report's original settings.
         * 
         */
        private decimal m_MarginLeft = 0;

        public decimal MarginLeft
        {
            get
            {
                return this.m_MarginLeft;
            }
            set
            {
                this.m_MarginLeft = value;
            }
        }


        /*
         * The right margin value, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 1in). This value overrides the report's original settings.
         *  
         */
        private decimal m_MarginRight = 0;

        public decimal MarginRight
        {
            get
            {
                return this.m_MarginRight;
            }
            set
            {
                this.m_MarginRight = value;
            }
        }

        /*
         * One of the Graphics Device Interface (GDI) supported output formats: BMP, EMF, GIF, JPEG, PNG, or TIFF.
         * 
         */
        private string m_OutputFormat = "EMF";

        public string OutputFormat
        {
            get
            {
                return this.m_OutputFormat;
            }
            set
            {
                this.m_OutputFormat = value;
            }
        }

        /*
         * The page height, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 11in). This value overrides the report's original settings.
         * 
         */
        private decimal m_PageHeight = 11;

        public decimal PageHeight
        {
            get
            {
                return this.m_PageHeight;
            }
            set
            {
                this.m_PageHeight = value;
            }
        }


        /*
         * The page width, in inches, to set for the report. You must include an integer or decimal value followed by "in" (for example, 8.5in). This value overrides the report's original settings.
         * 
         * 
        */
        private decimal m_PageWidth = 8.5m;

        public decimal PageWidth
        {
            get
            {
                return this.m_PageWidth;
            }
            set
            {
                this.m_PageWidth = value;
            }
        }

        public string DeviceInfoString
        {
            get
            {
                string strRet = string.Empty;

                strRet += "<DeviceInfo>" +
                    "  <OutputFormat>" + this.m_OutputFormat + "</OutputFormat>";

                if (this.m_Landscape)
                    strRet +=
                        "  <PageWidth>" + this.m_PageHeight.ToString() + "in</PageWidth>" +
                        "  <PageHeight>" + this.m_PageWidth.ToString() + "in</PageHeight>";
                else
                    strRet +=
                        "  <PageWidth>" + this.m_PageWidth.ToString() + "in</PageWidth>" +
                        "  <PageHeight>" + this.m_PageHeight.ToString() + "in</PageHeight>";

                strRet +=
                        "  <MarginTop>" + this.m_MarginTop.ToString() + "in</MarginTop>" +
                        "  <MarginLeft>" + this.m_MarginLeft.ToString() + "in</MarginLeft>" +
                        "  <MarginRight>" + this.m_MarginRight.ToString() + "in</MarginRight>" +
                        "  <MarginBottom>" + this.m_MarginBottom.ToString() + "in</MarginBottom>";

                strRet += "</DeviceInfo>";

                return strRet;

            }
        }



    }
}
